package com.github.sd4324530.fastweixin.util;


public final class BeanUtil {

    /**
     * 姝ょ被涓嶉渶瑕佸疄渚嬪寲
     */
    private BeanUtil() {
    }

    /**
     * 鍒ゆ柇瀵硅薄鏄惁涓簄ull
     *
     * @param object 闇�瑕佸垽鏂殑瀵硅薄
     * @return 鏄惁涓簄ull
     */
    public static boolean isNull(Object object) {
        return null == object;
    }

    /**
     * 鍒ゆ柇瀵硅薄鏄惁涓嶄负null
     *
     * @param object 闇�瑕佸垽鏂殑瀵硅薄
     * @return 鏄惁涓嶄负null
     */
    public static boolean nonNull(Object object) {
        return null != object;
    }

    /**
     * 鍒ゆ柇瀵硅薄鏄惁涓虹┖锛屽鏋滀负绌猴紝鐩存帴鎶涘嚭寮傚父
     *
     * @param object       闇�瑕佹鏌ョ殑瀵硅薄
     * @param errorMessage 寮傚父淇℃伅
     * @return 闈炵┖鐨勫璞�
     */
    public static Object requireNonNull(Object object, String errorMessage) {
        if (null == object) {
            throw new NullPointerException(errorMessage);
        }
        return object;
    }
}
